package interfaces.music5;
import static net.mindview.util.Print.*;

import polymorphism.music.Node;

interface Instrument{
	int VALUE =5;
	void play(Node n);
	void adjust();
}
class Wind implements Instrument{

	@Override
	public void play(Node n) {
		print(this +".play() " + n);
	}
	public String toString(){
		return "Wind";
	}
	@Override
	public void adjust() {
		print(this +".adjust() " );
	}
	
}
class Percussion implements Instrument {

	@Override
	public void play(Node n) {
		print(this +".play() " + n);
	}

	public String toString(){
		return "Percussion";
	}
	@Override
	public void adjust() {
		print(this +".adjust() " );
	}
	
}
class Stringed implements Instrument{

	public void play(Node n) {
		print(this +".play()" + n);
	}

	public String toString(){
		return "Stringed";
	}
	@Override
	public void adjust() {
		// TODO Auto-generated method stub
		print(this + ".adjust()");
	}
	
}

class Brass extends Wind{
	public String toString(){
		return "Brass";
	}
}
class Woodwind extends Wind{
	public String toString(){
		return "Woodwind";
	}
}
public class Music5 {
    static void tune(Instrument i) {
    	i.play(Node.MIDDLE_C);
    }
    static void tuneAll(Instrument[] e) {
    	for (Instrument i : e) {
			tune(i);
		}
    }
    public static void main(String[] args) {
		Instrument[] orchestra = {
				new Wind(),
				new Percussion(),
				new Stringed(),
				new Brass(),
				new Woodwind()
		};
		tuneAll(orchestra);
	}
}
